import request from '@/utils/request'

// 1. 登录接口函数
export const reqLogin = ({ mobile, password }) => {
  return request({
    url: '/sys/login',
    method: 'post',
    data: {
      mobile,
      password
    }
  })
}

// 2. 获取用户信息
export const reqGetUserInfo = () => {
  return request({
    url: '/sys/profile',
    method: 'get'
  })
}

// 3. 修改密码
export const reqUpdatePassword = ({ oldPassword, newPassword }) => {
  return request({
    url: '/sys/user/updatePass',
    method: 'put',
    data: {
      oldPassword,
      newPassword
    }
  })
}
